import React, { useState, useEffect } from 'react'
import { Grid, Image } from 'react-vant'
import { ImgAll } from './service/homeService'
export default function All() {

  let [list, setlist] = useState([])
  useEffect(() => {
    (async () => {
      let { data } = await ImgAll()
      if (data.code == 200) {
        setlist(data.rows)
      }
    })()
  }, [])

  return (
    <div>

      <Grid columnNum={3}>
        {list.map(item=>{
          return   <Grid.Item  key={item.id} ><Image round width='100' height='100' src={'/api'+item.imgUrl} />{item.serviceName}</Grid.Item >
        })}
      </Grid>

    </div>
  )
}

